using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameFirst
{
    /// <summary>
    /// Questo è il tipo principale per il gioco
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        public static GraphicsDeviceManager graphics;
        public Game1()
        {

            graphics = new GraphicsDeviceManager(this);
            //graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
            //graphics.DeviceCreated += new EventHandler<EventArgs>(graphics_DeviceCreated);
            //imposto la risuluzione
#if WINDOWS
            graphics.PreferredBackBufferWidth =800;
            graphics.PreferredBackBufferHeight = 600;
            graphics.ApplyChanges();
#elif WINDOWS_PHONE
            graphics.GraphicsProfile = GraphicsProfile.Reach;
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.ApplyChanges();
#endif
            //INIZIALIZZO menucomp
            menucomp.SongVol = 0.5f;
            menucomp.SongG = 0.5f;
            menucomp.risoluz = 0;
            menucomp.palla1 = 0;
            menucomp.palla2 = 0;
            menucomp.SaveExist = false;
            //Antialiasing
            #if WINDOWS
            graphics.PreferMultiSampling = true;
            #endif
            Content.RootDirectory = "Content";

        }
        //void graphics_DeviceCreated(object sender, EventArgs e)
        //{
        //}

        //void graphics_PreparingDeviceSettings(object sender,
        //  PreparingDeviceSettingsEventArgs e)
        //{
        //}

        protected override void Initialize()
        {
            this.Components.Add(new menu(this));
            this.Components.Add(new InputGame.InputManagerGame(this));
            base.Initialize();
        }
        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {

            // Consente di uscire dal gioco
            //if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            //    this.Exit();
            base.Update(gameTime);
        }
        protected override void Draw(GameTime gameTime)
        {

            base.Draw(gameTime);
        }
    }
}